import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import risk from "../views/risk.vue";
import riskSub from "../views/risk-sub.vue";
import price from "../views/price.vue";
import priceSub from "../views/price-sub.vue";
import caiwu from "../views/caiwu.vue";
import caiwuSub from "../views/caiwu-sub.vue";
import Vue2 from "../views/Vue2.vue";
import Vue2Sub from "../views/Vue2-sub.vue";
import Vue3 from "../views/Vue3.vue";
import Vue3Sub from "../views/Vue3-sub.vue";
const basename = process.env.NODE_ENV === "production" ? "/" : "";

Vue.use(VueRouter);

const routes = [
  {
    path: "/home",
    name: "home",
    component: Home,
  },
  // {
  //   path: "/react16",
  //   name: "react16",
  //   component: React16,
  // },
  // {
  //   path: "/react16-sub/:path",
  //   name: "react16-sub",
  //   component: React16Sub,
  // },
  // {
  //   path: "/react17",
  //   name: "react17",
  //   component: React17,
  // },
  // {
  //   path: "/react17-sub/:path",
  //   name: "react17-sub",
  //   component: React17Sub,
  // },
  {
    path: "/risk",
    name: "risk",
    component: risk,
  },
  {
    path: "/risk-sub/:path",
    name: "risk-sub",
    component: riskSub,
  },
  {
    path: "/price",
    name: "price",
    component: price,
  },
  {
    path: "/price-sub/:path",
    name: "price-sub",
    component: priceSub,
  },
  {
    path: "/caiwu",
    name: "caiwu",
    component: caiwu,
  },
  {
    path: "/caiwu-sub/:path",
    name: "caiwu-sub",
    component: caiwuSub,
  },
  // {
  //   path: "/vite",
  //   name: "vite",
  //   component: Vite,
  // },
  // {
  //   path: "/vite-sub/:path",
  //   name: "vite-sub",
  //   component: ViteSub,
  // },
  {
    path: "/vue2",
    name: "vue2",
    component: Vue2,
  },
  {
    path: "/vue2-sub/:path",
    name: "vue2-sub",
    component: Vue2Sub,
  },
  {
    path: "/vue3",
    name: "vue3",
    component: Vue3,
  },
  {
    path: "/vue3-sub/:path",
    name: "vue3-sub",
    component: Vue3Sub,
  },
  // {
  //   path: "/angular12",
  //   name: "angular12",
  //   component: Angular12,
  // },
  // {
  //   path: "/all",
  //   name: "all",
  //   component: Multiple,
  // },
  {
    path: "/",
    redirect: "/home",
  },
];

const router = new VueRouter({
  mode: "history",
  base: basename,
  routes,
});

export default router;
